<?php
	include_once '../config.inc.php';
	if($adminId <= 0){
		echo '<script type="text/javascript">location.href = \'login.php\';</script>';
		die(0);
	}
	$stmt = $pdo->prepare('select uid,uname,upwd,uzt from kp_admin');
	$stmt->execute();
	$usersArr = $stmt->fetchAll(PDO::FETCH_ASSOC);

?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<script src="../js/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/kpadmins.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" type="text/css" href="css/kpusers.css"/>
	
	<title>Document</title>
</head>
<body>
		<div id="edituser">
		<div class="title">
			后台管理->后台用户管理
		</div>
		<ul class="usertitle">
			<li class="c0">序号</li>
			<li class="c1">用户名</li>
			<li class="c2">密码</li>
			<li class="c6">状态</li>
			<li class="c9">操作</li>
		</ul>
		<div id="usersdiv">
			<?php
				foreach($usersArr as $user){ 
			?>
			<ul class="user">
				<li class="c0"><?php echo $user['uid']; ?></li>
				<li class="c1" contenteditable="true"><?php echo $user['uname']; ?></li>
				<li class="c2" contenteditable="true"></li>
				<li class="c6" contenteditable="true"><?php echo $user['uzt']; ?></li>
				<li class="goedit">[改]</li>
				<li class="godel">[删]</li>
			</ul>
			<?php } ?>
		</div>
		<div id="useradddiv">

			<ul class="user">
				<li class="c0"></li>
				<li class="c1" contenteditable="true"></li>
				<li class="c2" contenteditable="true"></li>
				<li class="c6">1</li>
				<li class="goadd">[增加]</li>
			</ul>
		</div>
		
		
		<!--调试AJAX输出错误用
			<pre id="request" style="width: 100%; float: left; height: auto;">
			
		</pre>-->
		
		
	</div>
</body>
</html>